<template>
    <el-tabs v-model="activeTag">
        <el-tab-pane :label="title" name="publish">
            <el-form ref="publishRef" :model="data" :rules="rules" label-width="100px" :inline="true" size="small">
                <el-form-item label="流程类型" prop="processType">
                    <el-select style="width: 260px;" v-model="data.processType" placeholder="流程类型">
                        <el-option label="公共流程" value="PUBLIC_TYPE" />
                        <el-option label="企业流程" value="TENANT_TYPE" />
                        <el-option label="部门流程" value="COMPANY_TYPE" />
                    </el-select>
                </el-form-item>
                <el-form-item label="流程名称" prop="processName">
                    <el-input style="width: 260px;" v-model.trim="data.processName" maxlength="20"
                        placeholder="请输入流程名称"></el-input>
                </el-form-item>
            </el-form>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
export default {
    props: {
        title: {
            type: String,
            required: true
        },
        data:{
            type: Object,
            required: false
        },
        rules: {
            type: Object,
            required: true,
        },
    },
    data() {
        return {
            activeTag: "publish",
        }
    },
    methods:{
        //重置表单
        reset() {
            this.$refs.publishRef.resetFields();
        },
        //校验表单
        validate() {
            let checkResult = true;
            this.$refs.publishRef.validate((valid) => {
                checkResult = valid;
            })
            return checkResult;
        },
    }
}
</script>

<style scoped lang="scss">
.el-form{
    padding:30px 30px
}
</style>